This section provides an example of adding a Content type drop down to the List Summary widget. The drop down lets the person dropping the widget on the page select from these choices.
Here is what the drop down looks like once it is implemented.
To add this drop down to the List Summary widget, follow these steps.
<tr> <td> DisplaySelectedContent:</td> <td> <asp:CheckBox ID="DisplaySelectedContentCheckBox" runat="server" /> </td> </tr> <tr> <td> ContentType: </td> <td> <asp:DropDownList ID="ContentTypeList" runat="server"> <asp:ListItem Value="AllTypes">AllTypes</asp:ListItem> <asp:ListItem Value="Content">Content</asp:ListItem> <asp:ListItem Value="Assets">Assets</asp:ListItem> </asp:DropDownList> </td> </tr>
private string _ContentType;
[WidgetDataMember("AllTypes")]
public string ContentType { get { return _ContentType; } set { _ContentType = value; } }
EditEvent
area, set the select list's value to ContentType.ContentTypeList.SelectedValue = ContentType;
ContentType = ContentTypeList.SelectedValue;
ListSummary1.ContentType = (CMSContentType)Enum.Parse(typeof(CMSContentType), ContentType);